package com.cskaoyan.service;

import com.cskaoyan.bean.Admin;
import com.cskaoyan.mapper.AdminMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    AdminMapper adminMapper;

    @Override
    public List<Admin> list() {
        return adminMapper.selectByExample(null);
    }

    @Override
    public void update(Integer id, Integer[] roleIds) {
        Admin admin = new Admin();
        admin.setId(id);
        admin.setRoleIds(roleIds);
        int i = adminMapper.updateByPrimaryKeySelective(admin);
    }
}
